package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerBlockAccountGetPlayerRecordsResponse extends BaseQLResponse
{
    /// <summary>
    /// 指定玩家的账号封禁纪录
    /// </summary>
    public List<ButlerBlockAccountAction> PlayerRecords;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj.getJSONObject("error_response");
        if (t != null && !t.isNullObject())
        {
            ErrCode = t.getString("code");
            ErrMsg = t.getString("msg");
        }
        else
        {
            t = jsonObj.getJSONObject("butler_block_account_get_player_records_response");
            PlayerRecords = new ArrayList<ButlerBlockAccountAction>();
            JSONArray arrPlayerRecords = t.getJSONObject("player_records").getJSONArray("butler_block_account_action");
            for (int i = 0; i < arrPlayerRecords.size(); ++i)
            {
                ButlerBlockAccountAction o = new ButlerBlockAccountAction();
                o.DeserializeFromJson(arrPlayerRecords.getJSONObject(i));
                PlayerRecords.add(o);
            }
        }
    }
}
